unit uFrmPesagemImp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uFrmBaseImp, frxChBox, frxExportCSV, frxExportText,
  frxExportImage, frxExportRTF, frxExportXML, frxExportXLS, frxExportHTML,
  frxClass, frxExportPDF, frxDBSet, StdCtrls, JvExStdCtrls, JvButton,
  JvCtrls, JvFooter, ExtCtrls, JvExExtCtrls, JvExtComponent,
  Telesis_EditEnh;

type
  TFrmPesagemImp = class(TFrmBaseImp)
    Label1: TLabel;
    txtCodigo: TEditEnh;
    txtNome: TEditEnh;
    procedure txtCodigoButton1(Sender: TObject);
    procedure txtCodigoEnter(Sender: TObject);
    procedure txtCodigoExit(Sender: TObject);
    procedure btnImprimirClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmPesagemImp: TFrmPesagemImp;

implementation

uses uDMGeral, Rot_Utilidade;

{$R *.dfm}

procedure TFrmPesagemImp.txtCodigoButton1(Sender: TObject);
begin
  inherited;
  txtCodigo.Text := Procura(DMGeral.qPessoa, 'PESSOACODIGO');
end;

procedure TFrmPesagemImp.txtCodigoEnter(Sender: TObject);
begin
  inherited;
  vAnt := -1;
end;

procedure TFrmPesagemImp.txtCodigoExit(Sender: TObject);
begin
  inherited;
  ValidaInteiroExit(DMGeral.qPessoa_Local, vAnt, ['PESSOANOME'],['CODIGO'],[txtCodigo],[txtNome]);
end;

procedure TFrmPesagemImp.btnImprimirClick(Sender: TObject);
begin
  inherited;
  if not ValComp(txtCodigo, StrToInt(txtCodigo.Text) = 0, 'Informe a pessoa!') then Exit;

  DMGeral.qPesagemImp.ParamByName('CODIGO').AsString := txtCodigo.Text;

  LoadReport(frxReport, DMGeral.qPesagemImp);
end;

end.
